3.2.17 \(\int \frac {(a+a \sec (c+d x))^2}{\sqrt {e \sin (c+d x)}} \, dx\) [117]

Optimal. Leaf size=139 \[ \frac {2 a^2 \text {ArcTan}\left (\frac {\sqrt {e \sin (c+d x)}}{\sqrt {e}}\right )}{d \sqrt {e}}+\frac {2 a^2 \tanh ^{-1}\left (\frac {\sqrt {e \sin (c+d x)}}{\sqrt {e}}\right )}{d \sqrt {e}}+\frac {3 a^2 F\left (\left .\frac {1}{2} \left (c-\frac {\pi }{2}+d x\right )\right |2\right ) \sqrt {\sin (c+d x)}}{d \sqrt {e \sin (c+d x)}}+\frac {a^2 \sec (c+d x) \sqrt {e \sin (c+d x)}}{d e} \]

[Out]

2*a^2*arctan((e*sin(d*x+c))^(1/2)/e^(1/2))/d/e^(1/2)+2*a^2*arctanh((e*sin(d*x+c))^(1/2)/e^(1/2))/d/e^(1/2)-3*a
^2*(sin(1/2*c+1/4*Pi+1/2*d*x)^2)^(1/2)/sin(1/2*c+1/4*Pi+1/2*d*x)*EllipticF(cos(1/2*c+1/4*Pi+1/2*d*x),2^(1/2))*
sin(d*x+c)^(1/2)/d/(e*sin(d*x+c))^(1/2)+a^2*sec(d*x+c)*(e*sin(d*x+c))^(1/2)/d/e

________________________________________________________________________________________

Rubi [A]
time = 0.22, antiderivative size = 139, normalized size of antiderivative = 1.00, number of steps used = 13, number of rules used = 10, integrand size = 25, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.400, Rules used = {3957, 2952, 2721, 2720, 2644, 335, 218, 212, 209, 2651} \begin {gather*} \frac {2 a^2 \text {ArcTan}\left (\frac {\sqrt {e \sin (c+d x)}}{\sqrt {e}}\right )}{d \sqrt {e}}+\frac {2 a^2 \tanh ^{-1}\left (\frac {\sqrt {e \sin (c+d x)}}{\sqrt {e}}\right )}{d \sqrt {e}}+\frac {a^2 \sec (c+d x) \sqrt {e \sin (c+d x)}}{d e}+\frac {3 a^2 \sqrt {\sin (c+d x)} F\left (\left .\frac {1}{2} \left (c+d x-\frac {\pi }{2}\right )\right |2\right )}{d \sqrt {e \sin (c+d x)}} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(a + a*Sec[c + d*x])^2/Sqrt[e*Sin[c + d*x]],x]

[Out]

(2*a^2*ArcTan[Sqrt[e*Sin[c + d*x]]/Sqrt[e]])/(d*Sqrt[e]) + (2*a^2*ArcTanh[Sqrt[e*Sin[c + d*x]]/Sqrt[e]])/(d*Sq
rt[e]) + (3*a^2*EllipticF[(c - Pi/2 + d*x)/2, 2]*Sqrt[Sin[c + d*x]])/(d*Sqrt[e*Sin[c + d*x]]) + (a^2*Sec[c + d
*x]*Sqrt[e*Sin[c + d*x]])/(d*e)

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 218

Int[((a_) + (b_.)*(x_)^4)^(-1), x_Symbol] :> With[{r = Numerator[Rt[-a/b, 2]], s = Denominator[Rt[-a/b, 2]]},
Dist[r/(2*a), Int[1/(r - s*x^2), x], x] + Dist[r/(2*a), Int[1/(r + s*x^2), x], x]] /; FreeQ[{a, b}, x] &&  !Gt
Q[a/b, 0]

Rule 335

Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> With[{k = Denominator[m]}, Dist[k/c, Subst[I
nt[x^(k*(m + 1) - 1)*(a + b*(x^(k*n)/c^n))^p, x], x, (c*x)^(1/k)], x]] /; FreeQ[{a, b, c, p}, x] && IGtQ[n, 0]
 && FractionQ[m] && IntBinomialQ[a, b, c, n, m, p, x]

Rule 2644

Int[cos[(e_.) + (f_.)*(x_)]^(n_.)*((a_.)*sin[(e_.) + (f_.)*(x_)])^(m_.), x_Symbol] :> Dist[1/(a*f), Subst[Int[
x^m*(1 - x^2/a^2)^((n - 1)/2), x], x, a*Sin[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n - 1)/2] &&
 !(IntegerQ[(m - 1)/2] && LtQ[0, m, n])

Rule 2651

Int[(cos[(e_.) + (f_.)*(x_)]*(a_.))^(m_)*((b_.)*sin[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[(-(b*Sin[e +
f*x])^(n + 1))*((a*Cos[e + f*x])^(m + 1)/(a*b*f*(m + 1))), x] + Dist[(m + n + 2)/(a^2*(m + 1)), Int[(b*Sin[e +
 f*x])^n*(a*Cos[e + f*x])^(m + 2), x], x] /; FreeQ[{a, b, e, f, n}, x] && LtQ[m, -1] && IntegersQ[2*m, 2*n]

Rule 2720

Int[1/Sqrt[sin[(c_.) + (d_.)*(x_)]], x_Symbol] :> Simp[(2/d)*EllipticF[(1/2)*(c - Pi/2 + d*x), 2], x] /; FreeQ
[{c, d}, x]

Rule 2721

Int[((b_)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Dist[(b*Sin[c + d*x])^n/Sin[c + d*x]^n, Int[Sin[c + d*x]
^n, x], x] /; FreeQ[{b, c, d}, x] && LtQ[-1, n, 1] && IntegerQ[2*n]

Rule 2952

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n_)*((a_) + (b_.)*sin[(e_.) + (f_.)*
(x_)])^(m_), x_Symbol] :> Int[ExpandTrig[(g*cos[e + f*x])^p, (d*sin[e + f*x])^n*(a + b*sin[e + f*x])^m, x], x]
 /; FreeQ[{a, b, d, e, f, g, n, p}, x] && EqQ[a^2 - b^2, 0] && IGtQ[m, 0]

Rule 3957

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_.), x_Symbol] :> Int[(g*Co
s[e + f*x])^p*((b + a*Sin[e + f*x])^m/Sin[e + f*x]^m), x] /; FreeQ[{a, b, e, f, g, p}, x] && IntegerQ[m]

Rubi steps

\begin {align*} \int \frac {(a+a \sec (c+d x))^2}{\sqrt {e \sin (c+d x)}} \, dx &=\int \frac {(-a-a \cos (c+d x))^2 \sec ^2(c+d x)}{\sqrt {e \sin (c+d x)}} \, dx\\ &=\int \left (\frac {a^2}{\sqrt {e \sin (c+d x)}}+\frac {2 a^2 \sec (c+d x)}{\sqrt {e \sin (c+d x)}}+\frac {a^2 \sec ^2(c+d x)}{\sqrt {e \sin (c+d x)}}\right ) \, dx\\ &=a^2 \int \frac {1}{\sqrt {e \sin (c+d x)}} \, dx+a^2 \int \frac {\sec ^2(c+d x)}{\sqrt {e \sin (c+d x)}} \, dx+\left (2 a^2\right ) \int \frac {\sec (c+d x)}{\sqrt {e \sin (c+d x)}} \, dx\\ &=\frac {a^2 \sec (c+d x) \sqrt {e \sin (c+d x)}}{d e}+\frac {1}{2} a^2 \int \frac {1}{\sqrt {e \sin (c+d x)}} \, dx+\frac {\left (2 a^2\right ) \text {Subst}\left (\int \frac {1}{\sqrt {x} \left (1-\frac {x^2}{e^2}\right )} \, dx,x,e \sin (c+d x)\right )}{d e}+\frac {\left (a^2 \sqrt {\sin (c+d x)}\right ) \int \frac {1}{\sqrt {\sin (c+d x)}} \, dx}{\sqrt {e \sin (c+d x)}}\\ &=\frac {2 a^2 F\left (\left .\frac {1}{2} \left (c-\frac {\pi }{2}+d x\right )\right |2\right ) \sqrt {\sin (c+d x)}}{d \sqrt {e \sin (c+d x)}}+\frac {a^2 \sec (c+d x) \sqrt {e \sin (c+d x)}}{d e}+\frac {\left (4 a^2\right ) \text {Subst}\left (\int \frac {1}{1-\frac {x^4}{e^2}} \, dx,x,\sqrt {e \sin (c+d x)}\right )}{d e}+\frac {\left (a^2 \sqrt {\sin (c+d x)}\right ) \int \frac {1}{\sqrt {\sin (c+d x)}} \, dx}{2 \sqrt {e \sin (c+d x)}}\\ &=\frac {3 a^2 F\left (\left .\frac {1}{2} \left (c-\frac {\pi }{2}+d x\right )\right |2\right ) \sqrt {\sin (c+d x)}}{d \sqrt {e \sin (c+d x)}}+\frac {a^2 \sec (c+d x) \sqrt {e \sin (c+d x)}}{d e}+\frac {\left (2 a^2\right ) \text {Subst}\left (\int \frac {1}{e-x^2} \, dx,x,\sqrt {e \sin (c+d x)}\right )}{d}+\frac {\left (2 a^2\right ) \text {Subst}\left (\int \frac {1}{e+x^2} \, dx,x,\sqrt {e \sin (c+d x)}\right )}{d}\\ &=\frac {2 a^2 \tan ^{-1}\left (\frac {\sqrt {e \sin (c+d x)}}{\sqrt {e}}\right )}{d \sqrt {e}}+\frac {2 a^2 \tanh ^{-1}\left (\frac {\sqrt {e \sin (c+d x)}}{\sqrt {e}}\right )}{d \sqrt {e}}+\frac {3 a^2 F\left (\left .\frac {1}{2} \left (c-\frac {\pi }{2}+d x\right )\right |2\right ) \sqrt {\sin (c+d x)}}{d \sqrt {e \sin (c+d x)}}+\frac {a^2 \sec (c+d x) \sqrt {e \sin (c+d x)}}{d e}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 72.92, size = 179, normalized size = 1.29 \begin {gather*} \frac {a^2 \cos ^4\left (\frac {1}{2} (c+d x)\right ) \sec (c+d x) \sec ^4\left (\frac {1}{2} \text {ArcSin}(\sin (c+d x))\right ) \left (2 \text {ArcTan}\left (\sqrt {\sin (c+d x)}\right ) \sqrt {\cos ^2(c+d x)}+3 \sqrt {\cos ^2(c+d x)} F\left (\left .\text {ArcSin}\left (\sqrt {\sin (c+d x)}\right )\right |-1\right )-\sqrt {\cos ^2(c+d x)} \log \left (1-\sqrt {\sin (c+d x)}\right )+\sqrt {\cos ^2(c+d x)} \log \left (1+\sqrt {\sin (c+d x)}\right )+\sqrt {\sin (c+d x)}\right ) \sqrt {\sin (c+d x)}}{d \sqrt {e \sin (c+d x)}} \end {gather*}

Warning: Unable to verify antiderivative.

[In]

Integrate[(a + a*Sec[c + d*x])^2/Sqrt[e*Sin[c + d*x]],x]

[Out]

(a^2*Cos[(c + d*x)/2]^4*Sec[c + d*x]*Sec[ArcSin[Sin[c + d*x]]/2]^4*(2*ArcTan[Sqrt[Sin[c + d*x]]]*Sqrt[Cos[c +
d*x]^2] + 3*Sqrt[Cos[c + d*x]^2]*EllipticF[ArcSin[Sqrt[Sin[c + d*x]]], -1] - Sqrt[Cos[c + d*x]^2]*Log[1 - Sqrt
[Sin[c + d*x]]] + Sqrt[Cos[c + d*x]^2]*Log[1 + Sqrt[Sin[c + d*x]]] + Sqrt[Sin[c + d*x]])*Sqrt[Sin[c + d*x]])/(
d*Sqrt[e*Sin[c + d*x]])

________________________________________________________________________________________

Maple [A]
time = 0.20, size = 163, normalized size = 1.17

method result size
default \(-\frac {a^{2} \left (3 \sqrt {-\sin \left (d x +c \right )+1}\, \sqrt {2 \sin \left (d x +c \right )+2}\, \left (\sqrt {\sin }\left (d x +c \right )\right ) \EllipticF \left (\sqrt {-\sin \left (d x +c \right )+1}, \frac {\sqrt {2}}{2}\right ) \sqrt {e}-4 \cos \left (d x +c \right ) \sqrt {e \sin \left (d x +c \right )}\, \arctanh \left (\frac {\sqrt {e \sin \left (d x +c \right )}}{\sqrt {e}}\right )-4 \cos \left (d x +c \right ) \sqrt {e \sin \left (d x +c \right )}\, \arctan \left (\frac {\sqrt {e \sin \left (d x +c \right )}}{\sqrt {e}}\right )-2 \sqrt {e}\, \sin \left (d x +c \right )\right )}{2 \sqrt {e}\, \cos \left (d x +c \right ) \sqrt {e \sin \left (d x +c \right )}\, d}\) \(163\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+a*sec(d*x+c))^2/(e*sin(d*x+c))^(1/2),x,method=_RETURNVERBOSE)

[Out]

-1/2/e^(1/2)/cos(d*x+c)/(e*sin(d*x+c))^(1/2)*a^2*(3*(-sin(d*x+c)+1)^(1/2)*(2*sin(d*x+c)+2)^(1/2)*sin(d*x+c)^(1
/2)*EllipticF((-sin(d*x+c)+1)^(1/2),1/2*2^(1/2))*e^(1/2)-4*cos(d*x+c)*(e*sin(d*x+c))^(1/2)*arctanh((e*sin(d*x+
c))^(1/2)/e^(1/2))-4*cos(d*x+c)*(e*sin(d*x+c))^(1/2)*arctan((e*sin(d*x+c))^(1/2)/e^(1/2))-2*e^(1/2)*sin(d*x+c)
)/d

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sec(d*x+c))^2/(e*sin(d*x+c))^(1/2),x, algorithm="maxima")

[Out]

e^(-1/2)*integrate((a*sec(d*x + c) + a)^2/sqrt(sin(d*x + c)), x)

________________________________________________________________________________________

Fricas [C] Result contains higher order function than in optimal. Order 9 vs. order 4.
time = 2.94, size = 197, normalized size = 1.42 \begin {gather*} \frac {{\left (3 \, \sqrt {2} \sqrt {-i} a^{2} \cos \left (d x + c\right ) {\rm weierstrassPInverse}\left (4, 0, \cos \left (d x + c\right ) + i \, \sin \left (d x + c\right )\right ) + 3 \, \sqrt {2} \sqrt {i} a^{2} \cos \left (d x + c\right ) {\rm weierstrassPInverse}\left (4, 0, \cos \left (d x + c\right ) - i \, \sin \left (d x + c\right )\right ) + 2 \, a^{2} \arctan \left (\frac {\sin \left (d x + c\right ) - 1}{2 \, \sqrt {\sin \left (d x + c\right )}}\right ) \cos \left (d x + c\right ) + a^{2} \cos \left (d x + c\right ) \log \left (\frac {\cos \left (d x + c\right )^{2} - 4 \, {\left (\sin \left (d x + c\right ) + 1\right )} \sqrt {\sin \left (d x + c\right )} - 6 \, \sin \left (d x + c\right ) - 2}{\cos \left (d x + c\right )^{2} + 2 \, \sin \left (d x + c\right ) - 2}\right ) + 2 \, a^{2} \sqrt {\sin \left (d x + c\right )}\right )} e^{\left (-\frac {1}{2}\right )}}{2 \, d \cos \left (d x + c\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sec(d*x+c))^2/(e*sin(d*x+c))^(1/2),x, algorithm="fricas")

[Out]

1/2*(3*sqrt(2)*sqrt(-I)*a^2*cos(d*x + c)*weierstrassPInverse(4, 0, cos(d*x + c) + I*sin(d*x + c)) + 3*sqrt(2)*
sqrt(I)*a^2*cos(d*x + c)*weierstrassPInverse(4, 0, cos(d*x + c) - I*sin(d*x + c)) + 2*a^2*arctan(1/2*(sin(d*x
+ c) - 1)/sqrt(sin(d*x + c)))*cos(d*x + c) + a^2*cos(d*x + c)*log((cos(d*x + c)^2 - 4*(sin(d*x + c) + 1)*sqrt(
sin(d*x + c)) - 6*sin(d*x + c) - 2)/(cos(d*x + c)^2 + 2*sin(d*x + c) - 2)) + 2*a^2*sqrt(sin(d*x + c)))*e^(-1/2
)/(d*cos(d*x + c))

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} a^{2} \left (\int \frac {1}{\sqrt {e \sin {\left (c + d x \right )}}}\, dx + \int \frac {2 \sec {\left (c + d x \right )}}{\sqrt {e \sin {\left (c + d x \right )}}}\, dx + \int \frac {\sec ^{2}{\left (c + d x \right )}}{\sqrt {e \sin {\left (c + d x \right )}}}\, dx\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sec(d*x+c))**2/(e*sin(d*x+c))**(1/2),x)

[Out]

a**2*(Integral(1/sqrt(e*sin(c + d*x)), x) + Integral(2*sec(c + d*x)/sqrt(e*sin(c + d*x)), x) + Integral(sec(c
+ d*x)**2/sqrt(e*sin(c + d*x)), x))

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sec(d*x+c))^2/(e*sin(d*x+c))^(1/2),x, algorithm="giac")

[Out]

integrate((a*sec(d*x + c) + a)^2/sqrt(e*sin(d*x + c)), x)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {{\left (a+\frac {a}{\cos \left (c+d\,x\right )}\right )}^2}{\sqrt {e\,\sin \left (c+d\,x\right )}} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + a/cos(c + d*x))^2/(e*sin(c + d*x))^(1/2),x)

[Out]

int((a + a/cos(c + d*x))^2/(e*sin(c + d*x))^(1/2), x)

________________________________________________________________________________________